<template>
  <div>
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
    <el-menu-item index="1">我的售后</el-menu-item>
    <el-menu-item index="2">申请售后</el-menu-item>
    </el-menu>
    <div v-show="index==1" class="showbox">
        <myAftersales @getIndex="getIndex"/>
    </div>
    <div v-show="index==2" class="showbox">
        <applyAftersale/>
    </div>
  </div>
</template>
<script>
import myAftersales from './myAftersales.vue';
import applyAftersale from './applyAftersale.vue';
export default {
    inject:['reload'],
    name:'AfterSales',
    data() {
      return {
        activeIndex: '1',
        activeIndex2: '1',
        index:2
      };
    },
    components:{
        myAftersales,
        applyAftersale
    },
    methods: {
      handleSelect(key, keyPath) {
        this.index=key
      },
      getIndex(value){
        this.index=value
      }
    }
    }
</script>
<style scoped>
    .el-menu-demo{
        margin-top:20px;
        margin-left:200px;
        width:1100px
    }
    .showbox{
        margin-left:200px;
        width:1100px;
        border: 1px solid gray;
    }
</style>
